package org.example.game.biweekly.game138;

/**
 * @Description: TODO
 * @Author wyatt
 * @Data 2024/08/03 20:45
 */
public class Solution001 {

    public static void main(String[] args) {
//        System.out.println(1/10);

        System.out.println(new Solution001().generateKey(987, 879, 798));
    }


    public int generateKey(int num1, int num2, int num3) {
        int num = 0;

        int n = 4;
        for (int i = 0; i < n; i++) {
            num += Math.min(num1%10, Math.min(num2%10, num3%10)) * Math.pow(10, i);
            num1 = num1/10;
            num2 = num2/10;
            num3 = num3/10;
            if (num1 == 0 || num2 == 0 || num3 == 0) {
                break;
            }
        }

        return num;
    }

}
